/* clock.h
 * By: Ariq Chowdhury
 * Date created: March 17th 2011
 * Date modified: March 17th 2011
 */

#ifndef _XXXOS_CLOCK_H
#define _XXXOS_CLOCK_H

#include <interrupt.h>
#include <stdint.h>

/*********************************/
/*** Defines**********************/
/*********************************/

#define TIMER0 0x40 /*Port to access Timer 0 (the one we will use for system)*/
#define TIMER_MODE 0x43 /*Port to set timer mode*/
#define SQUARE_WAVE 0x36 /*Data word to set timer to square wave */
#define TIMER_FREQ 1193180 /*Frequency of the 8253 timer*/
#define HZ 10000 /*Frequency we want from the timer*/
#define TIMER_COUNT ((uint16_t) (TIMER_FREQ/HZ))


/*********************************/
/*** Functions *******************/
/*********************************/

/* Function init_clock
 * void -> void
 * Post: System clock is set to interrupt at 10Hz
 * Returns: void
 */
void init_clock();

/* Function clock_handler
 * int_hook_t* -> int
 * Pre:
 * Post:
 * returns: 
 */
int clock_handler(int_hook_t* hook);
#endif /*_XXXOS_CLOCK_H*/
